#ifndef __SUBSYSTEM_BLOCKS_SCANNER_H__
#define __SUBSYSTEM_BLOCKS_SCANNER_H__

#include "GameStack.hpp"
#include "Subsystems/Subsystem.hpp"
#include "Engine/Point2.hpp"

using namespace PocketSurvival::Engine;

namespace PocketSurvival
{
    class SubsystemPollableBlockBehavior;
    class SubsystemTerrain;
    class SubsystemTimeOfDay;

    // 完成
    class SubsystemBlocksScanner : public Subsystem
    {
    protected:
        SubsystemTerrain *m_subsystemTerrain;
        SubsystemTimeOfDay *m_subsystemTimeOfDay;
        GameStack<Point2> m_waitHandleChunkStack;

        std::vector<SubsystemPollableBlockBehavior *> m_pollableBehaviorsByContents[1024];

    public:
        virtual const std::string &getName() const override;
        virtual void update(float dt) override;
        virtual void load(const nlohmann::json &json) override;
        virtual void save(nlohmann::json &json) override;
        virtual void saveToMsgJson(nlohmann::json &jsonData) override;
        virtual SubLoadEchelon getLoadEchelon() override;

        virtual SubUpdateType getUpdateType() override;

    public:
        SubsystemBlocksScanner();
    };

    inline SubsystemBlocksScanner::SubsystemBlocksScanner() {}
}

#endif
